package com.elvende.web.client.dto;

import java.io.Serializable;

import javax.jdo.annotations.Extension;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Learning implements Serializable{
		private static final long serialVersionUID = 1L;

		
		@PrimaryKey
	    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	    @Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
	    private String key;

	    @Persistent
	    private String name;
	    
	    @Persistent
	    private String answer;
	    
	    @Persistent
	    private String categories;
	    
	    private static int counter;
	    
		public Learning(){}
		
		public Learning(String name, String answer) {
	        this.name = name;
	        this.answer = answer;
	        this.key = ""+counter++;
	    }   
		
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public void setAnswer(String answer) {
			this.answer = answer;
		}

		public String getAnswer() {
			return answer;
		}
		
		public String getKey() {
			return key;
		}

		public void setCategory(String category) {
			this.categories = category;
		}

		public String getCategory() {
			return categories;
		}
}
